SG Window
Window Object

©1998 by Stinga

Reference    Properties    Methods    Events     Events     Constants    Errors    How To...
ProgID SGWindow.Window
CLSID A4F879B0-FA60-11d1-9828-204C4F4F5020
Description

Window object encapsulates Win32 window API in a rich set of easy to use properties and methods. With it, VB programmer can do almost anything a C/C++ programmer can:

Remarks

SG Window is not an ActiveX control and does not need to be placed on the form to be used. It is an automation compatible server component and can be used from a class module or regular BAS module.
This example shows how to use Window from the class module:

' Declare Window object
Private mWnd As Window

' Attach window handle
Public Property Let hWnd(h as Long)
   mWnd.hWnd = h
   If h <> 0 Then
      mWnd.EnableMessage WM_MOUSEWHEEL
      mWnd.Hooked = True
   Else
      mWnd.EnableMessage WM_MOUSEWHEEL, False
      mWnd.Hooked = False
   End If
End Property

' Standard initialization/destruction
Private Sub Class_Initialize()
   Set mWnd = new SGWindow.Window
End Sub
Private Sub Class_Terminate()
   Set mWnd = Nothing
End Sub

' Message event handler
Private Sub mWnd_Message(ByVal msg As Long, ByVal wParam As Long, _
                         ByVal lParam As Long, ByRef result As Long)
   Select Case msg
      Case WM_MOUSEWHEEL
      ' Put some cool code here
   End Select
End Sub